public class TestMem {
	public static void main(String[] args) {
		int a = 10;
		int b = a;
		b = 20;
		System.out.println(a+","+b);
		
		Person p1 = new Person();
		p1.name = "老张";
		Person p2 = p1;
		p2.name = "老李";
		p1.talk();
		p2.talk();
		System.out.println("----------------------------------");
		fn1();
	}
	
	public static void fn1() {
		int a = 10;
		int c = 20;
		a = c;
		c = 30;
		System.out.println(a+","+c);
		
		Person p1 = new Person();
		p1.name = "小李";
		Person p2 = new Person();
		p2.name = "小张";
		p1.talk();
		p2.talk();
		
		Person p3 = p2;
		p3.name = "小王";
		p1.talk();
		p2.talk();
		p3.talk();
		
		p1 = p3 ;
		p1.name = "小夏";
		p1.talk();
		p2.talk();
		p3.talk();
	}
}

class Person {
	String name;
	
	public void talk() {
		System.out.println(name);
	}
}